package cn.io1;

import java.io.*;

public class Test06 {
    public static void main(String[] args) {
        try(
                InputStreamReader isr = new InputStreamReader(new FileInputStream("move/gb18230.txt"),"gbk");
                OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("move/utf8.txt",true),"utf-8")
        ){
            int len;
            // while ((len=isr.read())!=-1){
            //     osw.write(len);
            // }
            char[] chars = new char[10];
            while ((len=isr.read(chars))!=-1){
                osw.write(chars,0,len);
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
